\(\int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)} \, dx\) [99]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 25, antiderivative size = 88 \[ \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)} \, dx=\frac {(a+b \arctan (c x))^2 \log \left (2-\frac {2}{1+i c x}\right )}{d}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,-1+\frac {2}{1+i c x}\right )}{d}+\frac {b^2 \operatorname {PolyLog}\left (3,-1+\frac {2}{1+i c x}\right )}{2 d} \]

[Out]

(a+b*arctan(c*x))^2*ln(2-2/(1+I*c*x))/d+I*b*(a+b*arctan(c*x))*polylog(2,-1+2/(1+I*c*x))/d+1/2*b^2*polylog(3,-1
+2/(1+I*c*x))/d

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {4988, 5004, 5114, 6745} \[ \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)} \, dx=\frac {i b \operatorname {PolyLog}\left (2,\frac {2}{i c x+1}-1\right ) (a+b \arctan (c x))}{d}+\frac {\log \left (2-\frac {2}{1+i c x}\right ) (a+b \arctan (c x))^2}{d}+\frac {b^2 \operatorname {PolyLog}\left (3,\frac {2}{i c x+1}-1\right )}{2 d} \]

[In]

Int[(a + b*ArcTan[c*x])^2/(x*(d + I*c*d*x)),x]

[Out]

((a + b*ArcTan[c*x])^2*Log[2 - 2/(1 + I*c*x)])/d + (I*b*(a + b*ArcTan[c*x])*PolyLog[2, -1 + 2/(1 + I*c*x)])/d
+ (b^2*PolyLog[3, -1 + 2/(1 + I*c*x)])/(2*d)

Rule 4988

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((x_)*((d_) + (e_.)*(x_))), x_Symbol] :> Simp[(a + b*ArcTan[c*x])
^p*(Log[2 - 2/(1 + e*(x/d))]/d), x] - Dist[b*c*(p/d), Int[(a + b*ArcTan[c*x])^(p - 1)*(Log[2 - 2/(1 + e*(x/d))
]/(1 + c^2*x^2)), x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && EqQ[c^2*d^2 + e^2, 0]

Rule 5004

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTan[c*x])^(p +
 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[e, c^2*d] && NeQ[p, -1]

Rule 5114

Int[(Log[u_]*((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(-I)*(a + b*Ar
cTan[c*x])^p*(PolyLog[2, 1 - u]/(2*c*d)), x] + Dist[b*p*(I/2), Int[(a + b*ArcTan[c*x])^(p - 1)*(PolyLog[2, 1 -
 u]/(d + e*x^2)), x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && EqQ[e, c^2*d] && EqQ[(1 - u)^2 - (1 - 2
*(I/(I - c*x)))^2, 0]

Rule 6745

Int[(u_)*PolyLog[n_, v_], x_Symbol] :> With[{w = DerivativeDivides[v, u*v, x]}, Simp[w*PolyLog[n + 1, v], x] /
;  !FalseQ[w]] /; FreeQ[n, x]

Rubi steps \begin{align*} \text {integral}& = \frac {(a+b \arctan (c x))^2 \log \left (2-\frac {2}{1+i c x}\right )}{d}-\frac {(2 b c) \int \frac {(a+b \arctan (c x)) \log \left (2-\frac {2}{1+i c x}\right )}{1+c^2 x^2} \, dx}{d} \\ & = \frac {(a+b \arctan (c x))^2 \log \left (2-\frac {2}{1+i c x}\right )}{d}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,-1+\frac {2}{1+i c x}\right )}{d}-\frac {\left (i b^2 c\right ) \int \frac {\operatorname {PolyLog}\left (2,-1+\frac {2}{1+i c x}\right )}{1+c^2 x^2} \, dx}{d} \\ & = \frac {(a+b \arctan (c x))^2 \log \left (2-\frac {2}{1+i c x}\right )}{d}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,-1+\frac {2}{1+i c x}\right )}{d}+\frac {b^2 \operatorname {PolyLog}\left (3,-1+\frac {2}{1+i c x}\right )}{2 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.51 (sec) , antiderivative size = 173, normalized size of antiderivative = 1.97 \[ \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)} \, dx=-\frac {i \left (b^2 \pi ^3+24 a^2 \arctan (c x)+48 a b \arctan (c x)^2+24 i b^2 \arctan (c x)^2 \log \left (1-e^{-2 i \arctan (c x)}\right )+48 i a b \arctan (c x) \log \left (1-e^{2 i \arctan (c x)}\right )+24 i a^2 \log (c x)-12 i a^2 \log \left (1+c^2 x^2\right )-24 b^2 \arctan (c x) \operatorname {PolyLog}\left (2,e^{-2 i \arctan (c x)}\right )+24 a b \operatorname {PolyLog}\left (2,e^{2 i \arctan (c x)}\right )+12 i b^2 \operatorname {PolyLog}\left (3,e^{-2 i \arctan (c x)}\right )\right )}{24 d} \]

[In]

Integrate[(a + b*ArcTan[c*x])^2/(x*(d + I*c*d*x)),x]

[Out]

((-1/24*I)*(b^2*Pi^3 + 24*a^2*ArcTan[c*x] + 48*a*b*ArcTan[c*x]^2 + (24*I)*b^2*ArcTan[c*x]^2*Log[1 - E^((-2*I)*
ArcTan[c*x])] + (48*I)*a*b*ArcTan[c*x]*Log[1 - E^((2*I)*ArcTan[c*x])] + (24*I)*a^2*Log[c*x] - (12*I)*a^2*Log[1
 + c^2*x^2] - 24*b^2*ArcTan[c*x]*PolyLog[2, E^((-2*I)*ArcTan[c*x])] + 24*a*b*PolyLog[2, E^((2*I)*ArcTan[c*x])]
 + (12*I)*b^2*PolyLog[3, E^((-2*I)*ArcTan[c*x])]))/d

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 12.26 (sec) , antiderivative size = 1449, normalized size of antiderivative = 16.47

method result size
parts \(\text {Expression too large to display}\) \(1449\)
derivativedivides \(\text {Expression too large to display}\) \(1451\)
default \(\text {Expression too large to display}\) \(1451\)

[In]

int((a+b*arctan(c*x))^2/x/(d+I*c*d*x),x,method=_RETURNVERBOSE)

[Out]

a^2/d*ln(x)-1/2*a^2/d*ln(c^2*x^2+1)-I*a^2/d*arctan(c*x)+b^2/d*(arctan(c*x)^2*ln(c*x)-arctan(c*x)^2*ln(c*x-I)+a
rctan(c*x)^2*ln(2*I*(1+I*c*x)^2/(c^2*x^2+1))-2/3*I*arctan(c*x)^3-arctan(c*x)^2*ln((1+I*c*x)^2/(c^2*x^2+1)-1)+a
rctan(c*x)^2*ln(1-(1+I*c*x)/(c^2*x^2+1)^(1/2))-2*I*arctan(c*x)*polylog(2,(1+I*c*x)/(c^2*x^2+1)^(1/2))+2*polylo
g(3,(1+I*c*x)/(c^2*x^2+1)^(1/2))+arctan(c*x)^2*ln(1+(1+I*c*x)/(c^2*x^2+1)^(1/2))-2*I*arctan(c*x)*polylog(2,-(1
+I*c*x)/(c^2*x^2+1)^(1/2))+2*polylog(3,-(1+I*c*x)/(c^2*x^2+1)^(1/2))+1/2*I*Pi*(csgn(I*((1+I*c*x)^2/(c^2*x^2+1)
-1)/(1+(1+I*c*x)^2/(c^2*x^2+1)))*csgn(((1+I*c*x)^2/(c^2*x^2+1)-1)/(1+(1+I*c*x)^2/(c^2*x^2+1)))-csgn(((1+I*c*x)
^2/(c^2*x^2+1)-1)/(1+(1+I*c*x)^2/(c^2*x^2+1)))^2+csgn(I*((1+I*c*x)^2/(c^2*x^2+1)-1))*csgn(I/(1+(1+I*c*x)^2/(c^
2*x^2+1)))*csgn(I*((1+I*c*x)^2/(c^2*x^2+1)-1)/(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(1-I*c*x)+1/2*I*(dilog(-1/2*I*(c*x+I))+ln(c*x-I)*ln(-1/2*I*(c*x+I)))-1/4*I*ln(c*x-I)^2)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.55 \[ \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)} \, dx=-\frac {b^{2} \log \left (\frac {2 \, c x}{c x - i}\right ) \log \left (-\frac {c x + i}{c x - i}\right )^{2} + 2 \, b^{2} {\rm Li}_2\left (-\frac {2 \, c x}{c x - i} + 1\right ) \log \left (-\frac {c x + i}{c x - i}\right ) + 4 i \, a b {\rm Li}_2\left (\frac {c x + i}{c x - i} + 1\right ) - 4 \, a^{2} \log \left (x\right ) + 4 \, a^{2} \log \left (\frac {c x - i}{c}\right ) - 2 \, b^{2} {\rm polylog}\left (3, -\frac {c x + i}{c x - i}\right )}{4 \, d} \]

[In]

integrate((a+b*arctan(c*x))^2/x/(d+I*c*d*x),x, algorithm="fricas")

[Out]

-1/4*(b^2*log(2*c*x/(c*x - I))*log(-(c*x + I)/(c*x - I))^2 + 2*b^2*dilog(-2*c*x/(c*x - I) + 1)*log(-(c*x + I)/
(c*x - I)) + 4*I*a*b*dilog((c*x + I)/(c*x - I) + 1) - 4*a^2*log(x) + 4*a^2*log((c*x - I)/c) - 2*b^2*polylog(3,
 -(c*x + I)/(c*x - I)))/d

Sympy [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)} \, dx=- \frac {i \left (\int \frac {a^{2}}{c x^{2} - i x}\, dx + \int \frac {b^{2} \operatorname {atan}^{2}{\left (c x \right )}}{c x^{2} - i x}\, dx + \int \frac {2 a b \operatorname {atan}{\left (c x \right )}}{c x^{2} - i x}\, dx\right )}{d} \]

[In]

integrate((a+b*atan(c*x))**2/x/(d+I*c*d*x),x)

[Out]

-I*(Integral(a**2/(c*x**2 - I*x), x) + Integral(b**2*atan(c*x)**2/(c*x**2 - I*x), x) + Integral(2*a*b*atan(c*x
)/(c*x**2 - I*x), x))/d

Maxima [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2}}{{\left (i \, c d x + d\right )} x} \,d x } \]

[In]

integrate((a+b*arctan(c*x))^2/x/(d+I*c*d*x),x, algorithm="maxima")

[Out]

-a^2*(log(I*c*x + 1)/d - log(x)/d) + 1/96*(-24*I*b^2*arctan(c*x)^3 + 12*b^2*arctan(c*x)^2*log(c^2*x^2 + 1) - 6
*I*b^2*arctan(c*x)*log(c^2*x^2 + 1)^2 + 3*b^2*log(c^2*x^2 + 1)^3 - 2*(384*b^2*c^2*integrate(1/16*x^2*arctan(c*
x)^2/(c^2*d*x^3 + d*x), x) + 192*b^2*c*integrate(1/16*x*arctan(c*x)*log(c^2*x^2 + 1)/(c^2*d*x^3 + d*x), x) + b
^2*log(c^2*x^2 + 1)^3/d - 576*b^2*integrate(1/16*arctan(c*x)^2/(c^2*d*x^3 + d*x), x) - 48*b^2*integrate(1/16*l
og(c^2*x^2 + 1)^2/(c^2*d*x^3 + d*x), x) - 1536*a*b*integrate(1/16*arctan(c*x)/(c^2*d*x^3 + d*x), x))*d - 8*I*(
b^2*arctan(c*x)^3/d - 12*b^2*c*integrate(1/16*x*log(c^2*x^2 + 1)^2/(c^2*d*x^3 + d*x), x) + 12*a*b*arctan(c*x)^
2/d + 48*b^2*integrate(1/16*arctan(c*x)*log(c^2*x^2 + 1)/(c^2*d*x^3 + d*x), x))*d)/d

Giac [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2}}{{\left (i \, c d x + d\right )} x} \,d x } \]

[In]

integrate((a+b*arctan(c*x))^2/x/(d+I*c*d*x),x, algorithm="giac")

[Out]

sage0*x

Mupad [F(-1)]

Timed out. \[ \int \frac {(a+b \arctan (c x))^2}{x (d+i c d x)} \, dx=\int \frac {{\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )}^2}{x\,\left (d+c\,d\,x\,1{}\mathrm {i}\right )} \,d x \]

[In]

int((a + b*atan(c*x))^2/(x*(d + c*d*x*1i)),x)

[Out]

int((a + b*atan(c*x))^2/(x*(d + c*d*x*1i)), x)